package  
{		
	import com.cupcakeengine.core.AbstractPreloader;
	import com.cupcakeengine.events.PreloaderEvent;
	import flash.events.IOErrorEvent;
	
	/**
	 * ...
	 * @author João Vítor de Souza
	 */
	public class Preloader extends AbstractPreloader
	{
		// ___________________________________________________________________ CONSTANTS	
		
		// ___________________________________________________________________ CLASS PROPERTIES
		
		// ___________________________________________________________________ INSTANCE PROPERTIES
		
		// ___________________________________________________________________ GETTERS AND SETTERS
		
		// ___________________________________________________________________ CONSTRUCTOR
		
		public function Preloader() { super(); }
		
		// ___________________________________________________________________ PUBLIC METHODS
		
		override protected function init():void 
		{
			
		}
		
		override protected function destroy():void 
		{
			
		}
		
		override protected function update(pct:Number):void 
		{			
			if (pct == 1) {				
				dispatchEvent(new PreloaderEvent(PreloaderEvent.PRELOADER_COMPLETE));
				dispatchEvent(new PreloaderEvent(PreloaderEvent.PRELOADER_DESTROY));
			}
		}
		
		// ___________________________________________________________________ PRIVATE METHODS
		
		// ___________________________________________________________________ EVENTS
		
		override protected function onIOError(e:IOErrorEvent):void 
		{
			trace(e);
		}
		
	}

}